package org.jeecg.common.constant.enums;

/**
 * 开关状态
 * @author: qiang.zhou
 * @date: 2024/4/1 14:26
 **/
public enum SwitchStatus implements BaseEnum<Integer, String> {

    ON(1, "1", "打开"),
    OFF(0, "0", "关闭");

    private Integer code;
    private String value;
    private String name;

    SwitchStatus(Integer code, String value, String name) {
        this.code = code;
        this.value = value;
        this.name = name;
    }

    @Override
    public Integer getCode() {
        return this.code;
    }

    public String getValue() {
        return this.value;
    }

    @Override
    public String getName() {
        return this.name;
    }

    public static boolean isOpen(Integer status) {
        return ON.getCode().equals(status);
    }

    public static boolean isOpen(String status) {
        return ON.getValue().equals(status);
    }

    public static boolean isClosed(Integer status) {
        return OFF.getCode().equals(status);
    }

    public static boolean isClosed(String status) {
        return OFF.getValue().equals(status);
    }



}
